package com.macro.mall.model.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@Data
public class ProductSyncRequest {
    @JsonProperty("out_product_id")
    private String outProductId;

    private String name;

    @JsonProperty("short_title")
    private String shortTitle;

    private String desc;
    private String path;

    @JsonProperty("top_image")
    private String topImage;

    @JsonProperty("category_id")
    private String categoryId;

    @JsonProperty("biz_create_time")
    private Long bizCreateTime;

    @JsonProperty("biz_update_time")
    private Long bizUpdateTime;

    @JsonProperty("package_detail")
    private PackageDetail packageDetail;

    private List<SkuItem> skus;

    @JsonProperty("product_type")
    private Integer productType;

    @JsonProperty("settle_type")
    private Integer settleType;

    @JsonProperty("poi_id_list")
    private List<String> poiIdList;

    @Data
    public static class PackageDetail {
        @JsonProperty("package_rooms")
        private List<PackageItem> packageRooms;

        @JsonProperty("package_foods")
        private List<PackageItem> packageFoods;

        @JsonProperty("package_entertainments")
        private List<PackageItem> packageEntertainments;

        @JsonProperty("package_others")
        private List<PackageItem> packageOthers;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class PackageItem {
        private String name;
        private Integer count;
        private String unit;
    }

    @Data
    public static class SkuItem {
        @JsonProperty("out_sku_id")
        private String outSkuId;

        private String name;

        @JsonProperty("sku_image")
        private String skuImage;

        @JsonProperty("origin_price")
        private Long originPrice;

        @JsonProperty("sale_price")
        private Long salePrice;

        private Integer status;
        private Map<String, String> ext;
    }
}
